package filesWatcher;


import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

import main.Declarations;

/**
 * a Runnable for using WatchDir in new thread  
 * 
 * @author Vladimir Sarkisyan & Erez Levy
 *
 */
public class WatcherAPI implements Runnable{

	@Override
	/**
	 * get the path of the directory that the files are
	 * and activate the WatchDir
	 * 
	 */
	public void run() {
		 Path dir = Paths.get(Declarations.instance.getPath());
		// TODO Auto-generated method stub
        try {
			new WatchDir(dir, false).processEvents();
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
